{%- set dns_proxy = salt['pillar.get']('default:OMV_SAMBA_DNSPROXY', 'no') -%}
{%- set log_file = salt['pillar.get']('default:OMV_SAMBA_LOGFILE', '/var/log/samba/log.%m') -%}
{%- set max_log_size = salt['pillar.get']('default:OMV_SAMBA_MAXLOGSIZE', '1000') -%}
{%- set logging = salt['pillar.get']('default:OMV_SAMBA_LOGGING', 'syslog') -%}
{%- set panic_action = salt['pillar.get']('default:OMV_SAMBA_PANICACTION', '/usr/share/samba/panic-action %d') -%}
{%- set encrypt_passwords = salt['pillar.get']('default:OMV_SAMBA_ENCRYPTPASSWORDS', 'true') -%}
{%- set passdb_backend = salt['pillar.get']('default:OMV_SAMBA_PASSDBBACKEND', 'tdbsam') -%}
{%- set obey_pam_restrictions = salt['pillar.get']('default:OMV_SAMBA_OBEYPAMRESTRICTIONS', 'no') -%}
{%- set unix_password_sync = salt['pillar.get']('default:OMV_SAMBA_UNIXPASSWORDSYNC', 'no') -%}
{%- set passwd_program = salt['pillar.get']('default:OMV_SAMBA_PASSWDPROGRAM', '/usr/bin/passwd %u') -%}
{%- set passwd_chat = salt['pillar.get']('default:OMV_SAMBA_PASSWDCHAT', '*Enter\snew\s*\spassword:* %n\\n *Retype\snew\s*\spassword:* %n\\n *password\supdated\ssuccessfully* .') -%}
{%- set pam_password_change = salt['pillar.get']('default:OMV_SAMBA_PAMPASSWORDCHANGE', 'yes') -%}
{%- set socket_options = salt['pillar.get']('default:OMV_SAMBA_SOCKETOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY') -%}
{%- set guest_account = salt['pillar.get']('default:OMV_SAMBA_GUESTACCOUNT', 'nobody') -%}
{%- set load_printers = salt['pillar.get']('default:OMV_SAMBA_LOADPRINTERS', 'no') -%}
{%- set disable_spoolss = salt['pillar.get']('default:OMV_SAMBA_DISABLESPOOLSS', 'yes') -%}
{%- set printing = salt['pillar.get']('default:OMV_SAMBA_PRINTING', 'bsd') -%}
{%- set printcap_name = salt['pillar.get']('default:OMV_SAMBA_PRINTCAPNAME', '/dev/null') -%}
{%- set unix_extensions = salt['pillar.get']('default:OMV_SAMBA_UNIXEXTENSIONS', 'yes') -%}
{%- set wide_links = salt['pillar.get']('default:OMV_SAMBA_WIDELINKS', 'no') -%}
{%- set create_mask = salt['pillar.get']('default:OMV_SAMBA_CREATEMASK', '0777') -%}
{%- set directory_mask = salt['pillar.get']('default:OMV_SAMBA_DIRECTORYMASK', '0777') -%}
{%- set map_to_guest = salt['pillar.get']('default:OMV_SAMBA_MAPTOGUEST', 'Bad User') -%}
{%- set aio_read_size = salt['pillar.get']('default:OMV_SAMBA_AIOREADSIZE', '16384') -%}
{%- set aio_write_size = salt['pillar.get']('default:OMV_SAMBA_AIOWRITESIZE', '16384') -%}
{%- set fruit_aapl = salt['pillar.get']('default:OMV_SAMBA_FRUIT_AAPL', 'yes') -%}
{{ pillar['headers']['multiline'] -}}
#======================= Global Settings =======================
[global]
workgroup = {{ config.workgroup }}
server string = {{ config.serverstring }}
dns proxy = {{ dns_proxy }}
log level = {{ config.loglevel }}
log file = {{ log_file }}
max log size = {{ max_log_size }}
logging = {{ logging }}
panic action = {{ panic_action }}
encrypt passwords = {{ encrypt_passwords }}
passdb backend = {{ passdb_backend }}
obey pam restrictions = {{ obey_pam_restrictions }}
unix password sync = {{ unix_password_sync }}
passwd program = {{ passwd_program }}
passwd chat = {{ passwd_chat }}
pam password change = {{ pam_password_change }}
socket options = {{ socket_options }}
guest account = {{ guest_account }}
load printers = {{ load_printers }}
disable spoolss = {{ disable_spoolss }}
printing = {{ printing }}
printcap name = {{ printcap_name }}
unix extensions = {{ unix_extensions }}
wide links = {{ wide_links }}
create mask = {{ create_mask }}
directory mask = {{ directory_mask }}
{%- if config.shares.share | rejectattr('guest', 'equalto', 'no') | list | length > 0 %}
map to guest = {{ map_to_guest }}
{%- endif %}
use sendfile = {% if config.usesendfile | to_bool %}yes{% else %}no{% endif %}
{%- if config.aio | to_bool %}
aio read size = {{ aio_read_size }}
aio write size = {{ aio_write_size }}
{%- endif %}
time server = {% if config.timeserver | to_bool %}yes{% else %}no{% endif %}
wins support = {% if config.winssupport | to_bool %}yes{% else %}no{% endif %}
{%- if config.winsserver | length > 0 %}
wins server = {{ config.winsserver }}
{%- endif %}
multicast dns register = no
# Special configuration for Apple's Time Machine
fruit:aapl = {{ fruit_aapl }}
{%- if config.extraoptions | length > 0 %}
# Extra options
{{ config.extraoptions }}
{%- endif %}
